package com.party.admin.task;

import com.party.admin.biz.copartner.CopartnerAnalyzeBizService;
import com.party.admin.biz.copartner.MemberCopartnerCountBizService;
import com.party.admin.biz.copartner.MemberCopartnerDetailBizService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 合伙人数据刷新
 * Created by wei.li
 *
 * @date 2017/3/30 0030
 * @time 15:39
 */
@Component(value = "quartzCopartnerAnalyze")
public class QuartzCopartnerAnalyze {

    @Autowired
    private CopartnerAnalyzeBizService copartnerAnalyzeBizService;

    @Autowired
    private MemberCopartnerCountBizService memberCopartnerCountBizService;

    @Autowired
    private MemberCopartnerDetailBizService memberCopartnerDeatilBizService;


    protected static Logger logger = LoggerFactory.getLogger(QuartzCopartnerAnalyze.class);

    /**
     * 刷新机构数据
     */
    public void refresh() {
        logger.info("开始刷新合伙人数据");
        try {
            synchronized (this) {
//                copartnerAnalyzeBizService.copartnerActivityData();
                memberCopartnerCountBizService.todayDate();
                memberCopartnerDeatilBizService.todayDate();
            }
        } catch (Exception e) {
            logger.error("刷新合伙人数据异常,", e);
        }
    }
}
